//
//  TaskEditingViewController.h
//  TimeTracker
//
//  Created by Michael Flakus on 2/23/13.
//  Copyright (c) 2013 Michael Flakus. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <sqlite3.h>

@protocol PropertyEditing
- (void)setValue:(id)newValue forEditedProperty:(NSString *)field;
@end


@interface TaskEditingViewController : UIViewController {
    /*
    id editedObject;
    NSString *editedPropertyKey;
    NSString *editedPropertyDisplayName;
    
    NSString *taskID;
    NSString *startTimeString;
    NSDate *startTime;
    NSString *endTimeString;
    NSDate *endTime;
    NSString *notes;
    
    id <PropertyEditing> sourceController;
     */
}


/*
 Aspects of the object being edited:
 The object itself, the name of the property being edited, and the name to display to the user.
 */
@property (nonatomic, retain) id editedObject;
@property (nonatomic, retain) NSString *editedPropertyKey;
@property (nonatomic, retain) NSString *editedPropertyDisplayName;

@property (nonatomic, retain) UIDatePicker *datePicker;


@property (nonatomic, retain) NSString *taskID;
@property (nonatomic, retain) NSString *startTimeString;
@property (nonatomic, retain) NSDate *startTime;
@property (nonatomic, retain) NSString *endTimeString;
@property (nonatomic, retain) NSDate *endTime;
@property (nonatomic, retain) NSString *notes;


// database variables
@property (nonatomic) sqlite3 *database;
@property (strong, nonatomic) NSString *databasePath;
@property (nonatomic, strong) NSMutableArray *categoryIds;
@property (nonatomic, strong) NSMutableArray *categoryNames;


@property (nonatomic, retain) id <PropertyEditing>  sourceController;

- (IBAction)cancel;
- (IBAction)save;

@end
